/// px转rem
@function px-to-rem($px, $base: 16) {
  @return ($px / $base) * 1rem;
}

/// 获取颜色透明度
@function alpha($color, $opacity) {
  @return rgba($color, $opacity);
}

/// 计算百分比
@function percent($value, $total) {
  @return ($value / $total) * 100%;
}

/// 合并两个字符串
@function str-concat($str1, $str2) {
  @return unquote('#{$str1}#{$str2}');
}

/// 获取最大值
@function max($values...) {
  $max: nth($values, 1);
  @each $val in $values {
    @if $val > $max {
      $max: $val;
    }
  }
  @return $max;
}

/// 获取最小值
@function min($values...) {
  $min: nth($values, 1);
  @each $val in $values {
    @if $val < $min {
      $min: $val;
    }
  }
  @return $min;
}
